package cn.edu.scau.cmi.zhangxiyang.Factory;

import cn.edu.scau.cmi.zhangxiyang.Factory.InsuranceProduct;

public class SimpleFactory {
	public static InsuranceProduct useProduct(String product) {
		InsuranceProduct p = null;
		
		if("BodyInjury".equalsIgnoreCase(product)) {
			p = new BodyInjury();
		}
		else if("CarDamage".equalsIgnoreCase(product)) {
			p = new CarDamage();
		}
		else if("Casualties".equalsIgnoreCase(product)) {
			p = new Casualties();
		}
		else {
			p = new MultipleAccidents();
		}
		
		return p;
	}

}
